﻿

#ifndef _OSA_MQUE_H_
#define _OSA_MQUE_H_

#include <osa.h>
 
typedef struct {

	Uint32 curRd;
	Uint32 curWr;
	Uint32 len;
	Uint32 count;
	Uint32 size;
	Uint32 block;
	char name[128];

	char *queue;

	pthread_mutex_t lock;
	pthread_cond_t  condRd;
	pthread_cond_t  condWr;

} OSA_MqueHndl;
 
#ifdef __cplusplus
extern "C" {
#endif

#include <osa_mqueue.h>

	int OSA_mqueCreate(OSA_MqueHndl *hndl, char* name, Uint32 maxLen, Uint32 maxSize, Uint32 block);
	int OSA_mqueDelete(OSA_MqueHndl *hndl);
	int OSA_mquePut(OSA_MqueHndl *hndl, char *buf, Uint32 size);
	int OSA_mqueGet(OSA_MqueHndl *hndl, char *buf, Uint32 size);
	Uint32 OSA_mqueGetQueuedCount(OSA_MqueHndl *hndl);
	int OSA_mqueIsEmpty(OSA_MqueHndl *hndl);


#ifdef __cplusplus
}
#endif

#endif /* _OSA_QUE_H_ */



